/* 基础样式 */
.textareaOne {
    width: 98%;
    height: 600px;
    padding: 10px;
    font-family: "Courier New", Courier, monospace;
    font-size: 16px;
    line-height: 1.5em;
    border: 2px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    color: #333;
    outline: none;
    resize: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 聚焦时边框亮起 */
.textareaOne:focus {
    border-color: #007BFF;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/* 鼠标所在行高亮 */
.textareaOne::-webkit-selection {
    background-color: #007BFF;
    color: #fff;
}

.textareaOne::selection {
    background-color: #007BFF;
    color: #fff;
}

/* 鼠标悬停时改变行高亮背景 */
.textareaOne:hover {
    background-color: #f0f0f0;
}

/* 鼠标悬停时当前行高亮 */
.textareaOne {
    position: relative;
}

.textareaOne:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1.5em; /* 同 line-height 一致 */
    background-color: rgba(0, 123, 255, 0.1);
    z-index: -1;
    pointer-events: none;
    transition: top 0.1s ease;
}

.textareaOne:hover:before {
    background-color: rgba(0, 123, 255, 0.2);
}

.textareaOne:focus:before {
    background-color: rgba(0, 123, 255, 0.3);
}

.textareaOne {
    background-attachment: local;
    background-image:
            linear-gradient(to right, rgba(0, 123, 255, 0.1) 1px, transparent 1px),
            linear-gradient(to right, rgba(0, 123, 255, 0.1) 1px, transparent 1px);
    background-size: 100% 1.5em;
    background-position: 0 0;
}

/* 使得选中行高亮时平滑地随着鼠标移动 */
.textareaOne:focus {
    background-position: 0 calc(var(--y, 0) * 1.5em);
}

/* 只有一行 */
.textareaTwo {
    resize: none;
    height: 5%;
    width: 10%;
    overflow: hidden;
    white-space: nowrap;
    text-align: left;
    padding: 0.5em;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: border-color 0.3s ease;
    spellcheck: false;
}

.textareaTwo:focus {
    border-color: #66afe9;
    box-shadow: 0 0 8px rgba(102, 175, 233, 0.6);
}

/* contenteditable 元素 */
[contenteditable="true"] {
    cursor: text; /* 显示文本光标 */
}

